import fetch from 'common/src/utils/fetch'

const api = {
  // 查询列表
  getList(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核中期检查 查询列表
  getReviewList(data) {
    return fetch({
      url: '/api/designservice/docMidCheckAudit/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查看中期检查 查询列表
  getViewList(data) {
    return fetch({
      url: '/api/designservice/docMidView/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查课题名称信息
  getSubjectDetail(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/preInsert',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 判断能否新增中期检查
  validateMidTermInsert(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/valiInsert',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查学生信息
  getStudentInfo(data) {
    return fetch({
      url: '/api/designservice/common/studentInfo',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 保存
  save(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/insert',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 提交
  submit(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/submit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 编辑
  update(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/update',
      method: 'put',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 删除
  delete(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/delete',
      method: 'delete',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核通过(驳回)
  approval(data) {
    return fetch({
      url: '/api/designservice/docMidCheckAudit/audit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  //批量 审核通过(驳回)
  batchApproval(data) {
    return fetch({
      url: '/api/designservice/docMidCheckAudit/batchAudit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查导师学生课题详情
  getSubjectInfo(data) {
    return fetch({
      url: '/api/designservice/optApproval/detail',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核中期检查 导出
  reviewExport(data) {
    return fetch({
      url: '/api/designservice/docMidCheckAudit/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查看中期检查 导出
  viewExport(data) {
    return fetch({
      url: '/api/designservice/docMidView/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 导出
  exportPdf(data) {
    return fetch({
      url: '/api/designservice/docMidCheck/exportPdf',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 中期检查导出状态
  getMidExportStatus(key) {
    return fetch({
      url: `/api/designservice/common/asyncProcessResult/${key}`,
      method: 'get',
      showMask: false
    })
  },
  // 中期检查导出状态
  getExportStatus(key) {
    return fetch({
      url: `/api/designservice/resultPublish/result/${key}`,
      method: 'get',
      showMask: false
    })
  },
  // 查学院
  getCollege() {
    let authId = localStorage.getItem('activeAuthId')
    return fetch({
      url: `/api/designservice/common/college?authId=${authId}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  // 根据毕业年份和学院查专业
  getSubject(data) {
    return fetch({
      url: '/api/designservice/common/findSubject',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查审核进度
  getProgress(applyNo) {
    return fetch({
      url: `/api/workflow/approval/selectApproFlow?no=${applyNo}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  }
}

export default api
